package com.fh.modules.ums.model;

import com.fh.modules.ums.entity.UmsMember;
import com.fh.modules.ums.entity.UmsMemberPartnerInfo;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @Description:
 * @author： qiujunda
 * @date： 2019/10/27 15:10
 */
@Data
public class MemberSimpleInfo implements Serializable {
    private static final long serialVersionUID = -2773840585696959625L;

    private Integer memeberId;

    private String username;

    private String phone;

    private String email;

    private String nickName;

    private String headPic;

    private Integer hasFocusWechat;
    //收藏数量
    private Integer collectionCount=0;
    //优惠券数量
    private Integer couponCount;
    //积分数量
    private Integer integration;
    //用户类型，0普通用户，1合伙人，2合伙人伙伴
    private Integer partnerType;
    //是否合伙人
    private boolean  partner;
    //合伙人等级
    private Integer partnerLevelId;
    //合伙人等级名称
    private String partnerLevelname;
    //总销量
    private BigDecimal sales;
    //团队人员数量
    private Integer teamPersonCount;
    //总提成
    private BigDecimal commission;

    public void copyProperty(UmsMember umsMember){
        this.partner=umsMember.getPartnerType()==1?true:false;
        this.hasFocusWechat=umsMember.getHasFocusWechat();
        this.partnerType=umsMember.getPartnerType();
        this.username=umsMember.getUsername();
        this.email=umsMember.getEmail();
        this.phone=umsMember.getPhone();
        this.memeberId=umsMember.getId();
        this.nickName=umsMember.getNickname();
        this.headPic=umsMember.getHeadPic();
        this.integration=umsMember.getCurrentIntegration();
    }
    public void copyProperty(UmsMemberPartnerInfo umsMemberPartnerInfo){
        this.sales=umsMemberPartnerInfo.getGrowth();
        this.teamPersonCount=umsMemberPartnerInfo.getTeamPersonCount();
        this.commission=umsMemberPartnerInfo.getPersonCommission();
    }

}
